<div class="row">
    <div class="col-lg-12">
        <div class="box">
            <div class="box-header">
                <h3 class="box-title">未完成事项</h3>
                <span style="color: red;">过期罚款200元，逾期不做每天罚款100元并且写检讨，贴在服务站公示</span>
            </div><!-- /.box-header -->
            <div class="box-body">
                <div id="example2_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">
                    <div class="row">
                        <div class="col-sm-6"></div>
                        <div class="col-sm-6"></div>
                    </div>
                    <div class="row">
                        <div class="col-sm-12 table-responsive">
                            <table class="table table-bordered table-hover dataTable">
                                <thead>
                                <tr role="row">
                                    <th>添加时间</th>
                                    <th>联系人</th>
                                    <th>做些什么呢?</th>
                                    <th>状态</th>
                                    <th>地址</th>
                                    <th>发布人</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                <?php foreach($data['query'] as $k){?>
                                    <?php if ($k['start'] == 0){?>
                                        <tr>
                                            <td class=""><?php echo $k['time']?></td>
                                            <td class=""><?php echo $k['mobile']?></td>
                                            <td class="">
                                                <?php
                                                $stext = mb_substr($k['text'], 0,15,'utf-8'); // 截断文本
                                                $st = strlen($k['text']);
                                                if ($st > 80) {
                                                    echo $stext;?>
                                                    .....
                                                    <button class="btn btn-primary btn-xs" data-toggle="modal" data-target="#query_calendar_<?php echo $k['entry'];?>_connent">查看更多</button>
                                                    <!-- Modal -->
                                                    <div class="modal fade bs-example-modal-sm" id="query_calendar_<?php echo $k['entry'];?>_connent" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
                                                      <div class="modal-dialog" role="document">
                                                        <div class="modal-content">
                                                          <div class="modal-header">
                                                            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                                                            <h4 class="modal-title" id="myModalLabel">更多</h4>
                                                          </div>
                                                          <div class="modal-body">
                                                            <?php echo $k['text'];?>
                                                          </div>
                                                          <div class="modal-footer">
                                                            <button type="button" class="btn btn-primary" data-dismiss="modal">关闭</button>
                                                          </div>
                                                        </div>
                                                      </div>
                                                    </div>
                                                <?php }else{ echo $k['text']; }?>
                                            </td>
                                            <td class="">
                                                <?php $id = $k['entry']; if ($k['num'] != 0){?>
                                                    <!-- Button trigger modal -->
                                                    <button type="button" class="btn btn-default btn-sm" data-toggle="modal" data-target="#calendar_list_<?php echo $id ?>" onclick='calendar_body_list(<?php echo $id ?>)'>
                                                        查看状态 <span class="badge bg-green"><?php echo $k['num'] ?></span>
                                                    </button>
                                                    <!-- Modal -->
                                                    <div class="modal fade modal" id="calendar_list_<?php echo $id ?>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
                                                        <div class="modal-dialog modal-lg" role="document">
                                                            <div class="modal-content table-responsive">
                                                                <div class="modal-header">
                                                                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                                                                    <h4 class="modal-title" id="myModalLabel">状态列表</h4>
                                                                </div>
                                                                <div class="modal-body">
                                                                    <div class="row">
                                                                        <div class="col-lg-12">
                                                                            <div class="box" style="border-top: 0px;">
                                                                                <div class="box-body">
                                                                                    <div id="example2_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">
                                                                                        <div class="row">
                                                                                            <div class="col-sm-12">
                                                                                                <table class="table table-bordered table-hover dataTable">
                                                                                                    <thead>
                                                                                                    <tr role="row">
                                                                                                        <td class="sorting">时间</td>
                                                                                                        <td class="sorting">内容</td>
                                                                                                        <td class="sorting">更新人</td>
                                                                                                    </tr>
                                                                                                    </thead>
                                                                                                    <tbody id='calendar_body_list_<?php echo $id ?>'>
                                                                                                    </tbody>
                                                                                                    <tfoot>
                                                                                                    <tr role="row">
                                                                                                        <td class="sorting">时间</td>
                                                                                                        <td class="sorting">内容</td>
                                                                                                        <td class="sorting">更新人</td>
                                                                                                    </tr>
                                                                                                    </tfoot>
                                                                                                </table>
                                                                                            </div>
                                                                                        </div>
                                                                                    </div><!-- /.box-body -->
                                                                                </div>
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <div class="modal-footer">
                                                                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                <?php } else{ echo "N/A";}?>
                                            </td>
                                            <td class="calendar-addr"><?php echo $k['addr']?></td>
                                            <td><?php echo $k['name']?></td>
                                            <td class="calendar-set">
                                                <button type="button" class="btn btn-success btn-xs" onclick='calendar_set("ok",<?php echo $id ?>)'> 确定</button>

                                                <!-- Calendar for set update modal -->
                                                <button type="button" class="btn btn-primary btn-xs" data-toggle="modal" data-target="#calendar_set_<?php echo $id ?>"> 更新</button>

                                                <button type="button" class="btn btn-danger  btn-xs" onclick='calendar_set("del",<?php echo $id ?>)'> 删除</button>

                                                <!-- Calendar for set update Modal -->
                                                <div class="modal fade modal-success" id="calendar_set_<?php echo $id ?>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
                                                    <div class="modal-dialog" role="document">
                                                        <div class="modal-content">
                                                            <div class="modal-header">
                                                                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                                                                <h4 class="modal-title" id="myModalLabel">更新状态</h4>
                                                            </div>
                                                            <div class="modal-body">
                                                                <input type="text" class="form-control" placeholder="填写更新内容" id="calendar_text_<?php echo $id ?>" style="height: 100px">
                                                            </div>
                                                            <div class="modal-footer">
                                                                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                                                                <button type="button" class="btn btn-primary" onclick='calendar_set("set",<?php echo $id ?>)'>保存</button>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </td>
                                        </tr>
                                        <?php /*endstart*/} /*endforeach*/ }?>
                                </tbody>
                                <tfoot>
                                <tr role="row">
                                    <th>添加时间</th>
                                    <th>联系人</th>
                                    <th>做些什么呢?</th>
                                    <th>状态</th>
                                    <th>地址</th>
                                    <th>操作</th>
                                </tr>
                                </tfoot>
                            </table>
                        </div>
                    </div>
                </div><!-- /.box-body -->
            </div>
        </div>
    </div>
</div>